package MyCar;

public class FactoryCar {
    public static Car getcar(String arg){
        Car carReturned=null;
        if(arg.equalsIgnoreCase("奔驰")){
            carReturned=new BencEntity();
        } else if (arg.equalsIgnoreCase("宝马")) {
            carReturned=new BMWEntity();
        }else if (arg.equalsIgnoreCase("兰博基尼")) {
            carReturned=new LamborghiniEntity();
        }
        return carReturned;
    }

}
